var pageii = null;
var grid = null;
$(function() {

	grid = lyGrid({
		pagId : 'paging',
		l_column : [{
			colkey : "training_date",
			name : "日期时间"
		},{
			colkey : "teaching_object",
			name : "部门",

		}, {
			colkey : "records_text",
			name : "主题",
			
		}],
		jsonUrl : rootPath + '/hrtrain/train_findByPage.shtml',
		dymCol:true,
		checkbox : true,
		serNumber : false
	});


	$("#details").click("click", function() {
		particulars();
	});
	$("#search").click("click", function() {// 绑定查询按扭
		
		var searchParams = $("#searchForm").serializeJson();
		grid.setOptions({
			data : searchParams
			
		});
	});
	
});



/*详情展示
 */
function particulars() {
	var cbox = grid.getSelectedCheckbox();
	if (cbox.length > 1) {
		layer.msg("只能选中一个");
		return;
	}
	if(cbox == ""){
		layer.msg("需要选择一个");
		return;
	}
	pageii = layer.open({
		title : "培训",
		type : 2,
		area : [ "1000px", "100%" ],
		content : rootPath + '/hrtrain/train_particulars.shtml?id=' + cbox
	});
}
